<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/2/19 0019
 * Time: 16:52
 */

namespace factory;

class FruitsShop implements Factory
{
    public function __construct()
    {
        echo "初始化了一个水果超市 \n";
    }

    // 生产
    public function produce($type = "")
    {
        switch ($type) {
            case "apple":
                return new Apple();
                break;
            default:
                echo "不支持生产的水果！ \n";
                break;
        }
    }
}